package com.tiny.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.tiny.remote.FeignRemoteService;

@RefreshScope
@RestController
public class FeignController {

	@Autowired
	FeignRemoteService feignRemoteService;

	@Value("${configword}")
	String configword;

	@GetMapping(value = "/getHello")
	public String getHello(@RequestParam String name) {
		return feignRemoteService.hello(name);
	}

	@GetMapping(value = "/testzuul")
	public String testzuul(@RequestParam String name) {
		return name + ",这是springcloud-feign-client的服务接口";
	}

	@GetMapping(value = "/testconfig")
	public String testconfig(@RequestParam String name) {
		return name + ",git配置值：" + configword;
	}
}